<?php
/*
Extension Name: Low-Cal Vanilla
Extension Url: http://lussumo.com/addons/index.php?PostBackAction=AddOn&AddOnID=315
Description: [experimental] Gunzip Vanilla pages.
Version: @@VERSION@@
Author: Dinoboff
Author Url: http://lussumo.com/community/account/2469/
*/


define('LOWCALVANILLA_DIR', dirname(__FILE__));
include_once(LOWCALVANILLA_DIR . '/library/Control.CompressPage.php');
include_once(LOWCALVANILLA_DIR . '/library/Functions.php');

// Install setting value.
LowCalVanilla_Install($Context, '0.4.alpha', LOWCALVANILLA_DIR);

if ($Configuration['LOWCALVANILLA_PACKER_ENABLE']) {
	// Replace the 4 core script by a packed one
	$Context->AddToDelegate('Head',
		'PreRender',
		'LowCalVanilla_PackJsFiles');
}

if ($Configuration['LOWCALVANILLA_GZIP_ALLOWED']) {
	// add Low-Cal Vanilla control. Should be the last control to render.
	$LowCalVanilla = new LowCalVanilla_CompressPage($Context);
	$Page->AddControl('Page_Unload', $LowCalVanilla, '1000');
}